package com.zust513.service;

import com.zust513.entity.Account;
import com.zust513.entity.Order;
import com.zust513.entity.Transaction;
import com.zust513.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

public interface ClientService {


    Account selectAccountById(Integer id);
    void updateUserInfo(User user);
    User selectUserById(Integer id);
    void updatePassword(String newpassword,Integer id);
    void insertOrder(Order order);
    Order selectLatestOrderByUserId(Integer id);
    void updateAccountPay(Integer userId, BigDecimal subtract, BigDecimal add);
    void insertTransaction(Transaction transaction);
    void updateAccountRecharge(Integer userId, BigDecimal totalRecharge, BigDecimal balance);
    void insertTransactionRecharge(Transaction transaction);
    BigDecimal sumExpenseAmountByAccountId(Integer accountId);

    Integer countExpenseRecordsByAccountId(Integer accountId);

    List<Transaction> getTransactionsByAccountId(Integer accountId);
    List<Order> getOrdersByUserId(@Param("userId") Integer userId);
    Order selectOrderByOrderId(Integer orderId);
    void updateDeliveryStatusToCompleted(Integer orderId);
}
